package priv.xml;

import java.io.FileOutputStream;
import java.io.IOException;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@ImportResource(locations= {"classpath:io.cfg.xml"})
public class IO_Spring {
	public static void main(String[] args) throws IOException {
		@SuppressWarnings("resource")
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(IO_Spring.class);
		FileOutputStream outputStream = context.getBean(FileOutputStream.class);
		String msg="today is goodday\r\n" + 
				"the cloud is not found\r\n" + 
				"the air is soo cold\r\n" + 
				"my foot quik missing";
		
		byte[] bytes = msg.getBytes();
		outputStream.write(bytes);
		outputStream.flush();
		System.out.println(msg);
	}
	
}
